/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2021-10-16     86188       the first version
 */
#ifndef APPLICATIONS_HARDWARE_UART_IDLE_DMA_UART_DMA_H_
#define APPLICATIONS_HARDWARE_UART_IDLE_DMA_UART_DMA_H_

#include <board.h>

typedef struct Uart
{
    rt_device_t serial;

    rt_mailbox_t txmb;
    rt_mailbox_t rxmb;

    rt_size_t (*send)(char *, rt_size_t);
    rt_size_t (*recv)(char *, rt_int32_t);

    rt_err_t (*input)(rt_device_t, rt_size_t);
    rt_err_t (*output)(rt_device_t, void*);

    int (*init)(uint32_t);
} USER_Uart;

#ifdef BSP_USING_USBDEVICE
extern USER_Uart USER_VCOM;
#endif

//#ifdef BSP_USING_UART1
//extern USER_Uart USER_UART1;
//#endif

#ifdef BSP_USING_UART3
extern USER_Uart USER_UART3;
#endif

#ifdef BSP_USING_UART4
extern USER_Uart USER_UART4;
#endif

#ifdef BSP_USING_UART6
extern USER_Uart USER_UART6;
#endif

#endif /* APPLICATIONS_HARDWARE_UART_IDLE_DMA_UART_DMA_H_ */
